/***************************************************************************//**
 * @file GUI/PFD_HSI.h
 * @author  Marek M. Cel <marekcel@mscsim.org>
 *
 * @section LICENSE
 *
 * Copyright (C) 2013 Marek M. Cel
 *
 * This file is part of MScSim. You can redistribute and modify it under
 * the terms of GNU General Public License as published by the Free Software
 * Foundation; either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.
 * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Further information about the GNU General Public License can also be found
 * on the world wide web at http://www.gnu.org.
 ******************************************************************************/
#ifndef PFD_HSI_H
#define PFD_HSI_H

////////////////////////////////////////////////////////////////////////////////

#include <QGraphicsView>
#include <QGraphicsSvgItem>

////////////////////////////////////////////////////////////////////////////////

class PFD_HSI
{
public:

    /** */
    PFD_HSI( QGraphicsScene *scene );

    /** */
    void init( float scaleX, float scaleY );

    /** */
    void update( float scaleX, float scaleY );

    /** @param heading [deg] */
    void setHeading( float heading );

private:

    QGraphicsScene *m_scene;    ///< graphics scene

    QGraphicsSvgItem  *m_itemBack;
    QGraphicsSvgItem  *m_itemFace;          ///< heading face
    QGraphicsSvgItem  *m_itemMarks;         ///< HSI markings
    QGraphicsTextItem *m_itemFrameText;     ///<

    QColor m_frameTextColor;

    QFont  m_frameTextFont;

    float m_heading;    ///< [deg]

    float m_scaleX;     ///<
    float m_scaleY;     ///<

    QPointF m_originalHsiCtr;
    QPointF m_originalBackPos;
    QPointF m_originalFacePos;
    QPointF m_originalMarksPos;
    QPointF m_originalFrameTextCtr;

    const int m_backZ;
    const int m_faceZ;
    const int m_marksZ;
    const int m_frameTextZ;

    /** */
    void reset();

    /** */
    void updateHeading();
};

////////////////////////////////////////////////////////////////////////////////

#endif // PFD_HSI_H
